<?php

require_once '../include/common.inc.php';


$query = "INSERT INTO Operationlog SET 
	username = '$name',
	softcode = '$code',
	imei = '$imei',
	Operationtime = '";
$nowDateTime = date("Y-m-d H:i:s");
$query = $query.$nowDateTime;
$query= $query."'";
$db->query($query);
	
//$query = "select count(*) as counter from userinfo where name = '$name'";
//$result=$db->get_one($query);
//$total = $result["counter"];
//
//if ($total == 1)
//{
//	$query = "select id from userinfo where name = '$name'";
//	$result=$db->get_one($query);
//	$userid = $result[id];
//
//	$query = "select id from softinfo where code = '$code'";
//	$result=$db->get_one($query);
//	$softid = $result[id];
//	
//	$query = "select id, packageid,ordertime from salesorder where isovertime = 0 and userid = $userid and softid = $softid order by ordertime desc";
//	$result=$db->get_one($query);
//	$packageid = $result[packageid];
//	$ordertime = $result[ordertime];
//	$salesorderid = $result[id];
//
//	$query = "select service from package where id = $packageid";
//	$result=$db->get_one($query);
//	$service = $result["service"];
//	
//	if (!empty($packageid))
//	{
//		$nowDate = date("Y-m-d");
//		$nowDate = date('Y-m-d',strtotime("$nowDate - $service month"));
//		$isover = (strtotime($nowDate) - strtotime("$ordertime"))/86400;
//		if($isover > 0){
//			$query = "update salesorder SET isovertime = '1'";
//			$query .= " where id= $salesorderid";
//			$db->query($query);
//		 	echo "no|你的服务已经过期,请联系客服人员";
//		}elseif($isover <= 0){
//		 	echo "ok";
//		} 
//	}
//	else
//	{
//		echo "no|你还没有开通服务,请联系客服人员";
//	}
//}
//else
{
	//echo "test|试用用户";
	//echo "no|你还没有注册使用本软件,请联系客服人员";
	echo "no|因为淘宝登录修改，所以本软件现在不能使用。多谢你们的支持！";
}
?>
